package rmaqlc31.basic;

public class J05_Patterns {

	public static void main(String[] args) {
		
		int a = 1;
		int b = 1;
		
		
		System.out.println("Pattern I");
		while(a<=6){
			while(b<=a){
				System.out.print(b + " ");
				++b;
			}
			System.out.println(" ");
			++a;
			b = 1;
		}
		a = 6;
		System.out.println("Pattern II");
		while(a>=1){
			while(b<=a){
				System.out.print(b + " ");
				++b;
			}
			System.out.println(" ");
			--a;
			b = 1;
		}
		
		System.out.println("Pattern III");
		a = 6;
		b = 1;
		while(b<=6){
			
			a = 6;
			while(a>=1){
				if(a>b)
					System.out.print("  ");
				else
					System.out.print(a+" ");
				--a;
			}
			System.out.println();
			++b;
			
		}
		
		System.out.println("Pattern IV");
		a = 1;
		b = 1;
		while(b<=6){
			
			a = 1;
			while(a<=6){
				if(a<b)
					System.out.print("  ");
				
				else
					System.out.print(a-b+1+" ");
				++a;
				
			}
			++b;
			System.out.println();
		}
		
		

	}

}
